package test01;

public class test2_Thread {
    public static void main(String[] args) throws InterruptedException {
        Mythred mythred = new Mythred();
        mythred.start();
        while (true) {
            Thread.sleep(1000);
            System.out.println("同时进行");
        }
    }

    static class Mythred extends Thread {
        @Override
        public void run() {
                while (true) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    System.out.println("测试");
                }
        }
    }
}
